package com.controller;

import com.model.PlacedHospital;
import com.model.SysUser;
import com.model.VenderDevice;
import com.page.GenericPage;
import com.po.*;
import com.result.Result;
import com.service.MiniProgramService;
import com.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Author: chihaojie
 * @Date: 2019/6/5 9:30
 * @Version 1.0
 * @Note 微信小程序接口
 */

@Api(value = "miniProgramApi", tags = {"XiaoChengXu"})
@CrossOrigin
@RestController
@RequestMapping("/miniProgram")
public class MiniProgramController {


    @Autowired
    private MiniProgramService miniProgramService;


    /**
     *  IOT :  Internet of Things   万物互联，物联网
     */


    /**
     * 消费者token校验
     *
     * @param code
     * @return
     */
    @ApiOperation(value = "消费者token校验", httpMethod = "GET", notes = "消费者token校验")
    @RequestMapping(value = "/wxValidateToken", method = RequestMethod.GET)
    public Result<CustomerLoginData> wxValidateToken(@RequestParam(value = "code") String code,
                                                     @RequestParam(value = "nickname", required = false) String nickname,
                                                     @RequestParam(value = "headImgUrl", required = false) String headImgUrl,
                                                     HttpServletRequest request, HttpServletResponse response) throws Exception {
        return miniProgramService.wxValidateToken(code, nickname, headImgUrl, request, response);
    }

    /**
     * 下单接口
     */
    @ApiOperation(value = "微信统一下单接口", httpMethod = "POST", notes = "微信统一下单接口")
    @RequestMapping(value = "/createOrder", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
    public Result<WXMiniProgramPayResultVO> wxCreateOrder(@RequestBody OrderRequestParamPO orderRequestParamPO, HttpServletRequest request, HttpServletResponse response) {
        return miniProgramService.wxCreateOrder(orderRequestParamPO, request, response);
    }

    /**
     * 订单重新支付
     */
    @ApiOperation(value = "微信订单重新支付接口", httpMethod = "POST", notes = "微信订单重新支付接口")
    @RequestMapping(value = "/wxRepay", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
    public Result<WXMiniProgramPayResultVO> wxRepay(@RequestBody WxRePayPO wxRePayPO, HttpServletRequest request, HttpServletResponse response) {
        return miniProgramService.wxRepay(wxRePayPO, request, response);
    }

    /**
     * 根据code获取openid
     */
    @RequestMapping(value = "/getCustomerOpenIdByCode", method = RequestMethod.GET)
    public Result<String> getCustomerOpenIdByCode(@RequestParam(value = "code") String code,
                                                  HttpServletRequest request, HttpServletResponse response) throws Exception {
        return miniProgramService.getCustomerOpenIdByCode(code, request, response);
    }


    /**
     * 根据openid获取用户的账户信息
     */
    @ApiOperation(value = "根据openid获取系统用户的账户信息", httpMethod = "GET", notes = "根据openid获取系统用户的账户信息")
    @RequestMapping(value = "/getSysUserInfo", method = RequestMethod.GET)
    public Result<SysUserVO> getSysUserInfo(@RequestParam Integer channelType, @RequestParam String code) throws Exception {
        return new Result<SysUserVO>().ok(miniProgramService.getSysUserInfo(channelType, code));
    }

    /**
     * 小程序绑定系统账号
     */
    @ApiOperation(value = "绑定系统账号", httpMethod = "GET", notes = "绑定系统账号")
    @RequestMapping(value = "/bindSysUser", method = RequestMethod.GET)
    public Result<SysUserBindVo> bindSysUser(@RequestParam Integer channelType, @RequestParam String openId, @RequestParam String nickName, @RequestParam String headImgUrl, @RequestParam String userName, @RequestParam String password) {
        return new Result<SysUserBindVo>().ok(miniProgramService.bindSysUser(channelType, openId, nickName, headImgUrl, userName, password));
    }


    /**
     * 查询商品列表
     */
    @ApiOperation(value = "查询商品列表 :1、售卖商品，2：租赁（陪护床）", httpMethod = "GET", notes = "查询商品列表: 1、售卖商品，2：租赁（陪护床）")
    @RequestMapping(value = "/getProductList", method = RequestMethod.GET)
    public Result<GenericPage<ProductVO>> getProductList(
            @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
            @RequestParam("productType") Integer productType, @RequestParam("deviceId") Long deviceId) {
        return miniProgramService.getProductList(pageNo, pageSize, productType, deviceId);
    }

    /**
     * 根据设备id和商品id查询商品详情
     */
    @ApiOperation(value = "根据设备id和商品id查询商品详情", httpMethod = "GET", notes = "根据设备id和商品id查询商品详情")
    @RequestMapping(value = "/getProductInfoByDeviceIdAndProductId", method = RequestMethod.GET)
    public Result<BoxProductVO> getProductInfoByDeviceIdAndProductId(@RequestParam("deviceId") Long deviceId, @RequestParam Long productId) {
        return miniProgramService.getProductInfoByDeviceIdAndProductId(deviceId, productId);
    }

    /**
     * 查询设备及仓位详情信息
     */
    @ApiOperation(value = "查询设备及仓位详情信息", httpMethod = "GET", notes = "查询设备及仓位详情信息")
    @RequestMapping(value = "/getVenderDevice", method = RequestMethod.GET)
    public Result<VenderDeviceMiniPVO> getVenderDevice(@RequestParam Long deviceId) {
        return new Result<VenderDeviceMiniPVO>().ok(miniProgramService.getVenderDevice(deviceId));
    }


    /**
     * 补货接口
     */
    @ApiOperation(value = "补货接口", httpMethod = "POST", notes = "补货接口")
    @RequestMapping(value = "/replenishProduct", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
    public Result<Boolean> replenishProduct(@RequestBody ReplenishPO replenishPO) {
        return new Result<Boolean>().ok(miniProgramService.replenishProduct(replenishPO));
    }


    //购买和租赁的相关接口

    /**
     * 查询设备某仓位的商品信息
     */
    @ApiOperation(value = "查询设备某仓位的商品信息", httpMethod = "GET", notes = "查询设备某仓位的商品信息")
    @RequestMapping(value = "/getBoxProduct", method = RequestMethod.GET)
    public Result<BoxProductVO> getVenderDevice(@RequestParam("deviceId") Long deviceId, @RequestParam("boxType") String boxType, @RequestParam("boxNum") String boxNum) {
        return new Result<BoxProductVO>().ok(miniProgramService.getBoxProduct(deviceId, boxType, boxNum));
    }


    /**
     * 获取用户的账号详情 包含 押金 信用分
     */
    @ApiOperation(value = "获取用户的账号详情 包含 押金 信用分 ", httpMethod = "GET", notes = "获取用户的账号详情 包含 押金 信用分")
    @RequestMapping(value = "/getCustomerAndAccount", method = RequestMethod.GET)
    public Result<CustomerAndAccountVO> getCustomerAndAccount(@RequestParam("customerId") Long customerId) {
        return new Result<CustomerAndAccountVO>().ok(miniProgramService.getCustomerAndAccount(customerId));
    }


    /**
     * 获取用户的账号详情 包含 押金 信用分
     */
    @ApiOperation(value = "根据id获取订单详情", httpMethod = "GET", notes = "根据id获取订单详情")
    @RequestMapping(value = "/getOrderById", method = RequestMethod.GET)
    public Result<OrdersBackQueryVO> getOrderById(@RequestParam("orderId") Long orderId) {
        return new Result<OrdersBackQueryVO>().ok(miniProgramService.getOrderById(orderId));
    }


    /**
     * 用户支付成功后，微信异步通知我们，这是暴露给微信的回调接口
     */
    @ApiOperation(value = "暴露给微信的回调接口", httpMethod = "GET", notes = "暴露给微信的回调接口")
    @RequestMapping(value = "/wxnotify")
    public Result wxnotify(HttpServletRequest request, HttpServletResponse response) throws Exception {
        return new Result().ok(miniProgramService.wxNotify(request, response));
    }

    /**
     * 押金充值
     */
    @ApiOperation(value = "押金充值", httpMethod = "GET", notes = "押金充值接口")
    @RequestMapping(value = "/rechargeDeposit")
    public Result<WXMiniProgramPayResultVO> rechargeDeposit(@RequestParam("channelType") Integer channelType, @RequestParam("openId") String openId, @RequestParam("deviceId") Long deviceId, HttpServletRequest request, HttpServletResponse response) throws Exception {
        return new Result<WXMiniProgramPayResultVO>().ok(miniProgramService.rechargeDeposit(channelType, openId, deviceId, request, response));
    }

    /**
     * 租赁陪护床接口
     */
    @ApiOperation(value = "租赁陪护床接口", httpMethod = "GET", notes = "租赁陪护床接口")
    @RequestMapping(value = "/rentBed")
    public Result<RentBedVO> rentBed(@RequestParam("channelType") Integer channelType, @RequestParam("openId") String openId, @RequestParam("deviceId") Long deviceId, @RequestParam("productId") Long productId, HttpServletRequest request, HttpServletResponse response) throws Exception {
        return miniProgramService.rentBed(channelType, openId, deviceId, productId, request, response);
    }

    /**
     * 查询待归还的陪护床
     */
    @ApiOperation(value = "查询待归还的陪护床", httpMethod = "GET", notes = "查询待归还的陪护床")
    @RequestMapping(value = "/getGiveBackBed")
    public Result<OrdersBackQueryVO> getGiveBackBed(@RequestParam("channelType") Integer channelType, @RequestParam("openId") String openId, HttpServletRequest request, HttpServletResponse response) throws Exception {
        return new Result<OrdersBackQueryVO>().ok(miniProgramService.getGiveBackBed(channelType, openId, request, response));
    }

    /**
     * 预还床
     */
    @ApiOperation(value = "预还床", httpMethod = "GET", notes = "预还床")
    @RequestMapping(value = "/preGiveBack")
    public Result<RentBedVO> preGiveBack(@RequestParam("channelType") Integer channelType, @RequestParam("openId") String openId, @RequestParam("deviceId") Long deviceId, HttpServletRequest request, HttpServletResponse response) throws Exception {
        return new Result<RentBedVO>().ok(miniProgramService.preGiveBack(channelType, openId, deviceId, request, response));
    }

    /**
     * 归还租赁床
     */
    @ApiOperation(value = "归还租赁床", httpMethod = "GET", notes = "归还租赁床")
    @RequestMapping(value = "/giveBack")
    public Result<WXMiniProgramPayResultVO> giveBack(@RequestParam("channelType") Integer channelType, @RequestParam("openId") String openId, @RequestParam("deviceId") Long deviceId, HttpServletRequest request, HttpServletResponse response) throws Exception {
        return new Result<WXMiniProgramPayResultVO>().ok(miniProgramService.giveBack(channelType, openId, deviceId, request, response));
    }


    /**
     * 设备端对归还进行确认
     *
     * @param deviceId
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    @ApiOperation(value = "设备端对归还进行确认", httpMethod = "GET", notes = "设备端对归还进行确认")
    @RequestMapping(value = "/ackGiveBack")
    public Result<Boolean> ackGiveBack(@RequestParam("deviceId") Long deviceId, @RequestParam("boxNum") String boxNum, @RequestParam("orderNum") String orderNum, HttpServletRequest request, HttpServletResponse response) throws Exception {
        return new Result<Boolean>().ok(miniProgramService.ackGiveBack(deviceId, boxNum, orderNum, request, response));
    }


    /**
     * 判断是否注册
     */
    @ApiOperation(value = "判断消费者是否注册", httpMethod = "GET", notes = "判断消费者是否注册")
    @RequestMapping(value = "/judgeRegistered")
    public Result<Boolean> judgeRegistered(@RequestParam("channelType") Integer channelType, @RequestParam("openId") String openId, HttpServletRequest request, HttpServletResponse response) throws Exception {
        return new Result<Boolean>().ok(miniProgramService.judgeRegistered(channelType, openId, request, response));
    }

    /**
     * 消费者注册
     */
    @ApiOperation(value = "消费者注册", httpMethod = "POST", notes = "消费者注册")
    @RequestMapping(value = "/customerRegister", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
    public Result<CustomerVO> customerRegister(@RequestBody CustomerBindPhomeNumPo bindPhomeNumPo, HttpServletRequest request, HttpServletResponse response) throws Exception {
        return new Result<CustomerVO>().ok(miniProgramService.customerRegister(bindPhomeNumPo, request, response));
    }

    /**
     * 获取医院列表
     */
    @ApiOperation(value = "根据代理商ID获取医院列表", httpMethod = "GET", notes = "根据代理商ID获取医院列表")
    @RequestMapping(value = "/getPlcacedHospital")
    public Result<List<PlacedHospital>> getPlcacedHospital(@RequestParam("agent") Long agent) throws Exception {
        return miniProgramService.getPlcacedHospital(agent);
    }


    /**
     * 注册设备
     */
    @ApiOperation(value = "注册设备", httpMethod = "POST", notes = "注册设备")
    @RequestMapping(value = "/registDevice", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
    public Result<VenderDeviceQueryVO> registDevice(@RequestBody VenderDevicePO venderDevicePO) {
        return miniProgramService.registDevice(venderDevicePO);
    }


    //ProductVO
    @ApiOperation(value = "获取设备", httpMethod = "GET", notes = "获取设备")
    @RequestMapping(value = "/getDevicePage", method = RequestMethod.GET)
    public Result<GenericPage<VenderDevice>> getDevicePage(@RequestParam("agent") Long agent, @RequestParam("pageNo") int pageNo, @RequestParam("pageSize") int pageSize) {
        VenderDeviceQueryPO po = new VenderDeviceQueryPO();
        po.setAgent(agent);
        po.setPageNo(pageNo);
        po.setPageSize(pageSize);
        return miniProgramService.getDevicePage(po);
    }

    /**
     * 随机获取10个设备
     */
    @ApiOperation(value = "随机获取10个设备列表", httpMethod = "GET", notes = "随机获取10个设备列表")
    @RequestMapping(value = "/getTenDeviceList", method = RequestMethod.GET)
    public Result<List<VenderDevice>> getTenDeviceList() {
        return miniProgramService.getTenDeviceList();
    }


    /**
     * 获取医院列表
     */
    @ApiOperation(value = "开锁", httpMethod = "GET", notes = "开锁")
    @RequestMapping(value = "/openLock")
    public Result<Boolean> openLock(@RequestParam("deviceId") Long deviceId, @RequestParam("boxNum") Integer boxNum, @RequestParam("boxType") Integer boxType) throws Exception {
        return miniProgramService.openLock(deviceId, boxNum, boxType);
    }


    /**
     * 模拟支付成功后的回调
     */
    @ApiOperation(value = "模拟支付成功后的回调", httpMethod = "GET", notes = "模拟支付成功后的回调")
    @RequestMapping(value = "/mockWXnotify")
    public Result mockWXnotify(@RequestParam("orderNum") String orderNum, HttpServletRequest request, HttpServletResponse response) throws Exception {
        return miniProgramService.mockWXnotify(orderNum, request, response);
    }

    /**
     * 移除仓位商品
     */
    @ApiOperation(value = "移除仓位商品", httpMethod = "GET", notes = "移除仓位商品")
    @RequestMapping(value = "/removeBoxProduct", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
    public Result<Boolean> removeBoxProduct(@RequestParam("deviceId") Long deviceId, @RequestParam("boxType") String boxType, @RequestParam("boxNum") String boxNum) {
        return new Result<Boolean>().ok(miniProgramService.removeBoxProduct(deviceId, boxType, boxNum));
    }


    /**
     * 生成小程序码
     */
    @ApiOperation(value = "生成设备小程序码", httpMethod = "GET", notes = "生成设备小程序码")
    @RequestMapping(value = "/getMiniProgramCode", method = RequestMethod.GET)
    public void getMiniProgramCode(@RequestParam("deviceSn") String deviceSn, HttpServletRequest request, HttpServletResponse response) {
        miniProgramService.getMiniProgramCode(deviceSn, request, response);
    }


    /**
     * 生成小程序二维码
     */
    @ApiOperation(value = "生成设备小程序二维码", httpMethod = "GET", notes = "生成设备小程序二维码")
    @RequestMapping(value = "/getMiniProgramQRCode", method = RequestMethod.GET)
    public void getMiniProgramQRCode(@RequestParam("deviceSn") String deviceSn, HttpServletRequest request, HttpServletResponse response) {
        miniProgramService.getMiniProgramQRCode(deviceSn, request, response);
    }

    /**
     * 生成小程序二维码
     */
    @ApiOperation(value = "生成设备小程序二维码", httpMethod = "GET", notes = "生成设备小程序二维码")
    @RequestMapping(value = "/getMiniProgramQRCodeNew", method = RequestMethod.GET)
    public void getMiniProgramQRCodeNew(@RequestParam("deviceSn") String deviceSn, HttpServletRequest request, HttpServletResponse response) {
        miniProgramService.getMiniProgramQRCodeNew(deviceSn, request, response);
    }


    /**
     * 购买商品微信扫描小程序码
     */
    @ApiOperation(value = "购买商品微信扫描小程序码", httpMethod = "GET", notes = "购买商品微信扫描小程序码")
    @RequestMapping(value = "/getMiniProgramProductBuyCode", method = RequestMethod.GET)
    public void getMiniProgramProductBuyCode(@RequestParam("deviceId") Long deviceId, @RequestParam("productId") Long productId, HttpServletRequest request, HttpServletResponse response) {
        miniProgramService.getMiniProgramProductBuyCode(deviceId, productId, request, response);
    }

    /**
     * 购买商品扫描码
     */
    @ApiOperation(value = "购买商品微信扫描二维码", httpMethod = "GET", notes = "购买商品微信扫描二维码")
    @RequestMapping(value = "/getMiniProgramProductBuyQRCode", method = RequestMethod.GET)
    public void getMiniProgramProductBuyQRCode(@RequestParam("deviceId") Long deviceId, @RequestParam("productId") Long productId, HttpServletRequest request, HttpServletResponse response) {
        miniProgramService.getMiniProgramProductBuyQRCode(deviceId, productId, request, response);
    }

    /**
     * 购买商品扫描码
     */
    @ApiOperation(value = "购买商品微信扫描二维码", httpMethod = "GET", notes = "购买商品微信扫描二维码")
    @RequestMapping(value = "/getMiniProgramProductBuyQRCodeNew", method = RequestMethod.GET)
    public void getMiniProgramProductBuyQRCodeNew(@RequestParam("deviceId") Long deviceId, @RequestParam("productId") Long productId, HttpServletRequest request, HttpServletResponse response) {
        miniProgramService.getMiniProgramProductBuyQRCodeNew(deviceId, productId, request, response);
    }


    /**
     * 还床二维码
     */
    @ApiOperation(value = "还床二维码", httpMethod = "GET", notes = "还床二维码")
    @RequestMapping(value = "/getGiveBackBedQRCode", method = RequestMethod.GET)
    public void getGiveBackBedQRCode(@RequestParam("deviceId") Long deviceId, @RequestParam("productId") Long productId, HttpServletRequest request, HttpServletResponse response) {
        miniProgramService.getGiveBackBedQRCode(deviceId, productId, request, response);
    }

    /**
     * 还床二维码
     */
    @ApiOperation(value = "还床二维码", httpMethod = "GET", notes = "还床二维码")
    @RequestMapping(value = "/getGiveBackBedQRCodeNew", method = RequestMethod.GET)
    public void getGiveBackBedQRCodeNew(@RequestParam("deviceId") Long deviceId, @RequestParam("productId") Long productId, HttpServletRequest request, HttpServletResponse response) {
        miniProgramService.getGiveBackBedQRCodeNew(deviceId, productId, request, response);
    }


    /**
     * 根据设备sn判断设备是否注册
     */
    @ApiOperation(value = "获取设备详情", httpMethod = "GET", notes = "获取设备详情")
    @RequestMapping(value = "/judgeDeviceRegistered", method = RequestMethod.GET)
    public Result<VenderDevice> judgeDeviceRegistered(@RequestParam String sn, @RequestParam Long agent) {
        return miniProgramService.judgeDeviceRegistered(sn, agent);
    }

    /**
     * 模拟退款
     */
    @ApiOperation(value = "模拟退款", httpMethod = "GET", notes = "模拟退款")
    @RequestMapping(value = "/mockRefund")
    public Result mockRefund(@RequestParam("orderNum") String orderNum, HttpServletRequest request, HttpServletResponse response) throws Exception {
        return miniProgramService.mockRefund(orderNum, request, response);
    }


    /**
     * 获取消费者订单列表
     */
    @ApiOperation(value = "获取消费者订单列表", httpMethod = "GET", notes = "获取消费者订单列表")
    @RequestMapping(value = "/getCustomerOrderList", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
    public Result<List<OrdersVO>> getCustomerOrderList(@RequestParam("customerId") Long customerId) {
        return miniProgramService.getCustomerOrderList(customerId);
    }


    /**
     * 获取消费者租赁订单列表
     */
    @ApiOperation(value = "获取消费者租赁订单列表", httpMethod = "GET", notes = "获取消费者租赁订单列表")
    @RequestMapping(value = "/getCustomerRentOrderList", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
    public Result<GenericPage<OrdersVO>> getCustomerRentOrderList(@RequestParam("customerId") Long customerId, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) {
        return miniProgramService.getCustomerRentOrderList(customerId, pageNo, pageSize);
    }

    /**
     * 获取消费者购买订单列表
     */
    @ApiOperation(value = "获取消费者购买订单列表", httpMethod = "GET", notes = "获取消费者购买订单列表")
    @RequestMapping(value = "/getCustomerSaleOrderList", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
    public Result<GenericPage<OrdersVO>> getCustomerSaleOrderList(@RequestParam("customerId") Long customerId, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) {
        return miniProgramService.getCustomerSaleOrderList(customerId, pageNo, pageSize);
    }

    /**
     * 获取消费者订单列表
     */
    @ApiOperation(value = "获取消费者押金订单列表", httpMethod = "GET", notes = "获取消费者押金订单列表")
    @RequestMapping(value = "/getCustomerRechargeOrderList", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
    public Result<List<OrdersVO>> getCustomerRechargeOrderList(@RequestParam("customerId") Long customerId) {
        return miniProgramService.getCustomerRechargeOrderList(customerId);
    }

    /**
     * 分页查询报修记录
     */
    @ApiOperation(value = "分页查询报修记录接口", httpMethod = "GET", notes = "分页查询报修记录接口-多条件查询")
    @RequestMapping(value = "/getDeviceRepairApplyPage", method = RequestMethod.GET)
    public Result<GenericPage<DeviceRepairApplyVO>> getDeviceRepairApplyPage(@RequestParam(value = "sysUserId") Long sysUserId,
                                                                             @RequestParam(value = "pageNo", defaultValue = "1") int pageNo,
                                                                             @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
        return miniProgramService.getDeviceRepairApplyPage(sysUserId, pageNo, pageSize);
    }


    /**
     * 查询详情接口
     */
    @ApiOperation(value = "查询保修详情接口", httpMethod = "GET", notes = "查询保修详情接口")
    @RequestMapping(value = "/getDeviceRepairApplyDetail", method = RequestMethod.GET)
    public Result<DeviceRepairApplyVO> getDeviceRepairApplyDetail(@RequestParam("id") Long id) {
        return miniProgramService.getDeviceRepairApplyDetail(id);
    }


    /**
     * 故障状态处理接口
     */
    @ApiOperation(value = "故障状态处理接口", httpMethod = "GET", notes = "故障状态处理接口")
    @RequestMapping(value = "/troubleShootStatus", method = RequestMethod.GET)
    public Result<Boolean> troubleShootStatus(@RequestParam("id") Long id, @RequestParam("troubleShootStatus") Integer troubleShootStatus) {
        return miniProgramService.troubleShootStatus(id, troubleShootStatus);
    }



}
